package com.gcb.common.enums;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 证书等级
 */
public enum EducationLevel {
    PRIMARY_SCHOOL(1, "小学"),
    JUNIOR_HIGH_SCHOOL(2, "初中"),
    SENIOR_HIGH_SCHOOL(3, "高中"),
    VOCATIONAL_SCHOOL(4, "职业学校"),
    JUNIOR_COLLEGE(5, "大专"),
    BACHELORS_DEGREE(6, "本科"),
    MASTERS_DEGREE(7, "硕士"),
    DOCTORAL_DEGREE(8, "博士"),
    POST_DOCTORAL(9, "博士后");

    private final Integer code;
    private final String info;

    EducationLevel(Integer code, String info) {
        this.code = code;
        this.info = info;
    }

    public Integer getCode() {
        return code;
    }

    public String getInfo() {
        return info;
    }

    public static List<Map<Integer,String>> toJson() {
        List<Map<Integer,String>> maps = new ArrayList<>();
        for (EducationLevel educationLevel : EducationLevel.values()) {
            Map<Integer,String> map = new HashMap<>();
            map.put(educationLevel.getCode(),educationLevel.getInfo());
            maps.add(map);
        }
        return maps;
    }
}
